<include file="Public:header" />
<script type="text/javascript"> 
$(function(){
    $('.main').each(function(index, element) {
       $(this).click(function(){
		   var id = $(this).attr('data-id');
		   if($(this).attr("checked")==true){
		   	  $("#child"+id+" :input").attr("checked",'checked');//取消
		   }else{
			  $("#child"+id+" :input").attr("checked",'');//正选 
		   }
	   });
    });
});
</script>
<style>
body{font-size:12px;}
.mr5{margin-right:5px;}.mb5{margin-bottom:5px;}
tr{min-height:50px;}
.ctrl{padding-bottom:15px;}
.ctrl b{color:#06F;}
.power{padding-bottom:20px; margin-bottom:20px; float:left; display:block; width:100%; border-bottom:1px dashed;}
.child{margin-left:50px; float:left;}
.child div{width:110px; float:left;}
.checknow{color:#06F;}
</style>
<div id="content">
	<div id="main">
    	<div class="pad20">
        	<include file="default:navig" />
        	<div>
            	<ul>
                	 <li style="float:left; margin:18px 0 0 10px;">提示: 设置成功后需重新设置方可生效!</li>
                </ul>
            	<p style="text-align:right;"><input onclick="selflo('{$lasturl}')" class="button" type="submit" value="返回上一级" /></p>
            </div>
			<div id="tabs">            
                <ul>
               		 <li><a href="#tabs-1">{$tabs}</a></li>
                </ul>               
                
                <div id="tabs-1">
                <form id="addPart" method="post" action="__APP__/Sysdo/power/">
                <input type="hidden" name="act" value="{$act}" />
                <input type="hidden" name="callback" value="{$callback}" />
                <input type="hidden" name="id" value="{$id}" />                
                <table border="0" cellpadding="0" cellspacing="0"> 
                 <tr style="display:none;">
                 	<td class="ctrl">
                    	<div class="fl mr5"><input type="checkbox"/><b>全选</b></div>
                        <div class="fl"><input type="checkbox"/><b>反选</b></div>
                    </td>    
                 </tr> 
				 <tr> 
                 	<td>
                    	<volist name="power" id="vo" key="k" empty="$empty">
                        	<?php $Father = !empty($res[$vo['key']]) ? 1 : 0; ?>
                            <div class="power">
                                <div class="title">
                                   <p><input name="power[{$vo.key}]" data-id="{$k}" class="main" type="checkbox" value="{$vo.key}" <if condition="$Father eq 1"> checked="checked"</if> /><b <if condition="$Father eq 1">class="checknow"</if>>{$vo.name}</b></p>
                                </div>
                                <div id="child{$k}" class="child">
                                   <volist name="vo.item" id="vv" empty="$empty">
                                   		<?php $Child = !empty($res[$vo['key']][item][$vv['name']]) ? 1 : 0; ?>
                                   		<div><input name="power[{$vo.key}][item][{$vv.name}]" class="passenger" type="checkbox" value="{$vv.name}" <if condition="$Child eq 1"> checked="checked"</if> /><span <if condition="$Child eq 1">class="checknow"</if>>{$vv.value}</span></div>
                                   </volist>
                                </div>
                            </div>
                        </volist>
                    </td>
                 </tr>                           	                                
                 <tr style="height:50px;">
                 	<td colspan="2"><input class="button" type="submit" value="保存权限" style="width:100px;" /></td>
                 </tr>
                 </table>
                 </form>
                </div>                                 
			</div>  
        </div>
	</div>
</div>            
                
<include file="Public:footer" />    